function ProsAndCons($scope) {

    $scope.pros = new Array();
    $scope.cons = new Array();
    $scope.selected = "";
    $scope.result = "";

    $scope.addPro = function() {
       $scope.pros.push($scope.selected);
       update();
    };

    $scope.addCon = function() {
        $scope.cons.push($scope.selected);
        update();
    };

    $scope.remove = function() {
        const indexOfSelectedCon = $scope.cons.indexOf($scope.selected);
        if (indexOfSelectedCon != -1) {
            $scope.cons.splice(indexOfSelectedCon);
        }

        const indexOfSelectedPro = $scope.pros.indexOf($scope.selected);
        if (indexOfSelectedPro != -1) {
            $scope.pros.splice(indexOfSelectedPro);
        }

        update();
    };

    $scope.selectItem = function($selectedValue) {
      $scope.selected = $selectedValue;
        update();
    };

    function update() {
       if ($scope.pros.length == $scope.cons.length) {
            $scope.result = "";
        } else if ($scope.pros.length > $scope.cons.length) {
            $scope.result = "Pro is winner";
        } else {
            $scope.result = "Con is winner";
        }
    }
}